<template>
  <div>
    <component :is="currentComponent"  :transferOrderNo=transferOrderNo :wmsTransfer=editData @goNextAdd="add" @goNextEdit="edit" @handleCancel="handleCancel" ref="childComponent" />
  </div>
</template>

<script>
import List from "./list"
import AddWmsTransfer from "./addWmsTransfer";
import EditWmsTransfer from "./editWmsTransfer";

export default {
  name: "Index",
  components:{
    List,
    AddWmsTransfer,
    EditWmsTransfer
  },
  data(){
    return{
      currentComponent:"List",
      transferOrderNo:"",
      editData:{}
    }
  },
  created() {
  },
  methods:{
    add(transferOrderNo){
      this.transferOrderNo=transferOrderNo;
      this.currentComponent="AddWmsTransfer";
    },
    edit(data){
      this.editData = data;
      this.currentComponent="EditWmsTransfer";
    },
    handleCancel(){
      this.currentComponent = "List"
    },
  },


}
</script>
